﻿using UnityEngine;
using System.Collections;

public class BloodManager
{
    private static BloodManager bloodManager = null;

    protected GameObject uiGameObj = null;

    protected GameObject uiSimpleBlood = null;

    public static BloodManager GetInstance()
    {
        if (null == bloodManager)
        {
            bloodManager = new BloodManager();
            bloodManager.Start();
        }

        return bloodManager;
    }

    public void Start()
    {
        UnityEngine.Object objPrefab = Resources.Load("UI/BloodAll");

        uiGameObj = (GameObject)GameObject.Instantiate(objPrefab, Vector3.zero, Quaternion.identity);

        uiSimpleBlood = uiGameObj.transform.Find("Simple").gameObject;
    }

    public UISimpleBlood CreateSimpleBlood()
    {
        GameObject newSimpleBloodGameObj = (GameObject)GameObject.Instantiate(uiSimpleBlood, Vector3.zero, Quaternion.identity);
        newSimpleBloodGameObj.transform.parent = uiGameObj.transform;

        UISimpleBlood newSimpleBlood = new UISimpleBlood(newSimpleBloodGameObj);

        return newSimpleBlood;
    }

}
